跳到主要内容

GetDocument

Returns the main document.

Syntax

expression.GetDocument();

expression - A variable that represents a Api class.

Parameters

This method doesn't have any parameters.

Returns

ApiDocument

Example

This example shows how to get a document.

let doc = Api.GetDocument();
let paragraph = Api.CreateParagraph();
paragraph.AddText("This is a new paragraph");
doc.Push(paragraph);